<?php

namespace App\Http\Requests\V3_2_7;

use Illuminate\Foundation\Http\FormRequest;

class MessBoardRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'pageSize' => 'required|integer',//页面大小
            'currentPage' => 'required|integer|min:1',//当前页
        ];
    }

    /**
     * 验证错误信息.
     *
     * @return array
     */
    public function messages(): array
    {
        return [
            'pageSize.integer' => '参数`pageSize`缺失',
            'currentPage.integer' => '参数`currentPage`缺失',
            'pageSize.integer' => '参数`pageSize`仅能为数字',
            'currentPage.integer' => '参数`currentPage`仅能为数字',
            'currentPage.min' => '当前页码最小为1',
        ];
    }
}
